package com.woke.bean;

import java.util.List;

import com.woke.dao.Customer;
import com.woke.dao.User;
import com.woke.dao.WokeDao;

public class CustomerBean {
	public static List getCustomerList(String sql) {
		return Customer.getData(sql);
	}
	
	public static List getCustomerList1() {
		String sql="select * from customer";
		return Customer.getData(sql);
	}
	
	public static List getCustomerList2() {
		String sql="select * from customer where isdele=1";
		return Customer.getData(sql);
	}
	
	public static List getCustomerList3() {
		String sql="select * from customer where isdele=0";
		return Customer.getData(sql);
	}
	
	public static List getCustomerList4() {
		String sql="select * from customer where isprize='yes'";
		return Customer.getData(sql);
	}
	
	
	public static List getCustomerList5() {
		String sql="select * from customer where isprize='no'";
		return Customer.getData(sql);
	}
	
	public static void updateCusid(String id,String isdele) {
		String sql = "update customer set isdele='" + isdele + "' where id=" + id;
		WokeDao.updateMySqlData(sql);
	}
	
	public static void updateCustomer(String id,String belongId,String cusname,String isprize) {
		String sql = "update customer set belongId='"+belongId+"', cusname='" + cusname + "',isprize='"+isprize+"' where id=" + id;
		WokeDao.updateMySqlData(sql);
	}

	
	public static void addcustomer(String belongId,String cusname,String isprize) {
		String sql = "insert into customer(belongId,cusname,isprize) values('"+belongId+"','" + cusname + "','"+isprize+"')";
		WokeDao.updateMySqlData(sql);
	}
	
	public static void deleteCus(String id) {
		String sql = "delete from customer where id=" + id;
		WokeDao.updateMySqlData(sql);
	}
}
